@extends('backend.layouts.app')

@section('title', $title = $oddsHandicap->id ? '赔率盘口编辑' : '赔率盘口盘口' )

@section('breadcrumb')
    <a href="">系统设置</a>
    <a href="">盘口管理</a>
    <a href="">{{$title}}</a>
@endsection

@section('content')
    <div class="layui-main">

        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend>{{ $title }}</legend>
        </fieldset>

        <form class="layui-form layui-form-pane" method="POST"
              action="{{ $oddsHandicap->id ? route('odds_handicap.update', $oddsHandicap->id) : route('odds_handicap.store') }}">
            {{ csrf_field() }}
            <input type="hidden" name="_method" class="mini-hidden" value="{{ $oddsHandicap->id ? 'PATCH' : 'POST' }}">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">盘口编号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="code" lay-verify="required" placeholder="请输入盘口编号"
                               autocomplete="off" class="layui-input" value="{{ old('code',$oddsHandicap->code) }}">
                    </div>
                    <div class="layui-form-mid layui-word-aux">建议平台名称+盘口号</div>
                </div>


            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">平台</label>
                    <div class="layui-input-block">
                        <select name="plat_id" lay-verify="required" lay-search="">
                            <option value="">请选择游戏分类</option>
                            @foreach($plats as $plat)
                                <option value={{$plat->id}} @if((integer)$oddsHandicap->plat_id===$plat->id) selected @endif>{{$plat->main_game_plat_name}}</option>
                            @endforeach
                        </select>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">平台盘口编号</label>
                    <div class="layui-input-inline">
                        <input type="text" name="plat_code" lay-verify="required" placeholder="请输入平台盘口编号"
                               autocomplete="off" class="layui-input"
                               value="{{ old('plat_code',$oddsHandicap->plat_code) }}">
                    </div>
                    <div class="layui-form-mid layui-word-aux">参考对应平台api文档</div>
                </div>


            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" title="赔率">赔率</label>
                    <div class="layui-input-inline">
                        <input type="text" name="odds_value" lay-verify="required|number" placeholder="请输入赔率"
                               autocomplete="off" class="layui-input"
                               value="{{ old('odds_value',$oddsHandicap->odds_value) }}">
                    </div>
                    <div class="layui-form-mid layui-word-aux">必须为数字</div>
                </div>
            </div>
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label" title="盘口描述">盘口描述</label>
                    <div class="layui-input-block">
                        <input type="text" name="description" lay-verify=""
                               placeholder="请输入盘口描述"
                               autocomplete="off" class="layui-input"
                               value="{{ old('description',$oddsHandicap->description) }}">
                    </div>
                </div>
            </div>


            <div class="layui-form-item">
                <button class="layui-btn" lay-submit="" lay-filter="demo1">提交</button>
                <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            </div>
        </form>
    </div>
@endsection

@section('scripts')
@endsection